home *** CD-ROM | disk | FTP | other *** search
- property pTextName, pWhatChanges, pWhatShows, pDestination, pTemp, pGroupName, pInitialState, pNumStates, pComplexString, ancestor
- global gCurrentText, gDownloadTexts
-
- on beginSprite me
- set pTemp to "temp"
- set previousItemDelimiter to the itemDelimiter
- set the itemDelimiter to "."
- set pTextName to item 1 of the name of the member of sprite the spriteNum of me
- set the itemDelimiter to previousItemDelimiter
- if pWhatShows = #gCurrentTextStatus then
- if pInitialState = #on then
- set gCurrentText to pTextName
- sendAllSprites(#UpdateDetail, #text)
- end if
- else
- if pWhatShows = #selectedToDownLoadStatus then
- if pTextName = "gCurrent" then
- if getPos(gDownloadTexts, gCurrentText) then
- set pInitialState to #on
- else
- set pInitialState to #off
- end if
- else
- if getPos(gDownloadTexts, pTextName) then
- set pInitialState to #on
- else
- set pInitialState to #off
- end if
- end if
- end if
- end if
- if pNumStates = #complex then
- set pNumStates to value(pComplexString)
- end if
- set numTrans to pNumStates
- if pWhatShows = #nothing then
- set togSty to 0
- else
- set togSty to 1
- end if
- set selfTog to pWhatChanges = pWhatShows
- set togGrup to pGroupName
- set togState to pInitialState
- if pWhatShows = #gCurrentTextStatus then
- set togOffbl to 0
- else
- if pWhatShows = #selectedToDownLoadStatus then
- set togOffbl to 1
- end if
- end if
- if pWhatChanges = #gCurrentTextStatus then
- set togOnOthOff to 1
- else
- set togOnOthOff to 0
- end if
- set ancestor to new(script "Bitmap But 1", the spriteNum of me, numTrans, togSty, togGrup, togState, togOffbl, selfTog, togOnOthOff)
- UpdateWhatItShows(me)
- end
-
- on MouseUpAction me
- if pWhatChanges = #gCurrentTextStatus then
- set gCurrentText to pTextName
- sendAllSprites(#UpdateDetail, #text)
- sendAllSprites(#UpdateWhatItShows)
- else
- if pWhatChanges = #selectedToDownLoadStatus then
- if pTextName = "gCurrent" then
- if not getPos(gDownloadTexts, gCurrentText) then
- append(gDownloadTexts, gCurrentText)
- else
- deleteAt(gDownloadTexts, getPos(gDownloadTexts, gCurrentText))
- end if
- else
- if not getPos(gDownloadTexts, pTextName) then
- append(gDownloadTexts, pTextName)
- else
- deleteAt(gDownloadTexts, getPos(gDownloadTexts, pTextName))
- end if
- end if
- end if
- end if
- if pDestination <> EMPTY then
- go(pDestination)
- end if
- end
-
- on MouseDownAction me
- nothing()
- end
-
- on MouseEnterAction me
- nothing()
- end
-
- on MouseLeaveAction me
- nothing()
- end
-
- on UpdateWhatItShows me
- if pWhatShows = #selectedToDownLoadStatus then
- if pTextName = "gCurrent" then
- if getPos(gDownloadTexts, gCurrentText) then
- set state to #on
- else
- set state to #off
- end if
- else
- if getPos(gDownloadTexts, pTextName) then
- set state to #on
- else
- set state to #off
- end if
- end if
- if not (state = the pToggleState of me) then
- set the pToggleState of me to state
- setstate(me, the pCurrentState of me)
- end if
- end if
- end
-
- on getPropertyDescriptionList me
- set description to [:]
- addProp(description, #pInitialState, [#default: #off, #format: #symbol, #comment: "Initial State", #range: [#off, #on]])
- addProp(description, #pWhatChanges, [#default: #gCurrentTextStatus, #format: #symbol, #comment: "What It Changes", #range: [#nothing, #gCurrentTextStatus, #selectedToDownLoadStatus]])
- addProp(description, #pWhatShows, [#default: #gCurrentTextStatus, #format: #symbol, #comment: "What It Shows", #range: [#nothing, #gCurrentTextStatus, #selectedToDownLoadStatus]])
- addProp(description, #pGroupName, [#default: "TextButtons", #format: #string, #comment: "Toggle Group Name"])
- addProp(description, #pDestination, [#default: EMPTY, #format: #string, #comment: "Frame Destination"])
- addProp(description, #pNumStates, [#default: 3, #format: #symbol, #comment: "Number of States", #range: [2, 3, 4, 5, 6, #complex]])
- addProp(description, #pComplexString, [#default: "[[1,0],[1,0],[1,0],[#m,0],[#m,0],[#m,0]]", #format: #string, #comment: "Complex Array"])
- return description
- end
-
- on getBehaviorDescription me
- set endChar to offset("--END OF HEADER", the text of me)
- set endLine to the number of lines in char 1 to endChar of the text of me - 1
- set description to line 1 to endLine of the text of me
- repeat with whichLine = endLine down to 1
- if line whichLine of description = EMPTY then
- delete line whichLine of description
- end if
- end repeat
- delete line 1 of description
- return description
- end
-